<!doctype html>
<html>
 <head> 
  <meta charset="utf-8"> 
  <title>openTable openTable - layui 第三方组件平台</title> 
  <meta name="renderer" content="webkit"> 
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> 
  <meta name="description" content="可展开显示更多内容的Table【应用在表格列过多时，支持layui.table的所有参数 + 4个扩展参数详情见文档】【专业解决表格列过多问题】"> 
  <link rel="stylesheet" href="/t/font_24081_60slu02pimt.css">
  <link rel="stylesheet" href="/layui/dist/css/layui.css">
  <link rel="stylesheet" href="/static/css/fly/global.css" charset="utf-8">
  <link rel="stylesheet" href="/static/css/global.css" charset="utf-8">
  <link rel="stylesheet" href="/static/css/global.css" charset="utf-8">
 </head>
 <body>
  <div class="layui-header header header-extends" style="background-color: #24262F;"> 
   <div class="layui-container"> <a class="logo" href="https://layui.itmtr.cn/"> <img src="/static/images/layui/logo.png" alt="layui"> </a> 
    <div class="layui-form component" lay-filter="LAY-site-header-component"></div> 
    <ul class="layui-nav"> 
     <li class="layui-nav-item layui-hide-xs"> <a href="//layui.itmtr.cn/">框架</a> </li> 
     <li class="layui-nav-item layui-hide-xs layui-this"> <a href="/extend/index.html">扩展</a> </li> 
     <li class="layui-nav-item"> <a href="javascript:;">周边</a> 
      <dl class="layui-nav-child layui-nav-child-c"> 
       <dd lay-unselect> <a href="//layui.itmtr.cn/alone.html" target="_blank">独立组件</a> 
       </dd> 
       <dd class="layui-hide-sm layui-show-xs" lay-unselect> <a href="/extend/index.html">扩展组件</a> 
        <hr> 
       </dd> 
      </dl> </li> 
    </ul> 
   </div>
  </div><!--[if lt IE 9]>  <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>  <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script><![endif]--> 
  <div class="fly-extend-banner fly-extend-banner-sm"> 
   <div class="layui-carousel" id="FLY-extend-banner" data-height="200px"> 
    <div carousel-item> 
     <div style="background-image: url(/upload/2018_8/168_1535373858670_8825.jpg)">
      <div style="background: rgba(0,0,0,.6)"></div> 
     </div> 
    </div> 
   </div> 
   <h1 class="fly-extend-banner-title">layui 第三方组件平台</h1> 
   <div class="fly-extend-banner-release"> <a href="/extend/index.html" class="layui-btn layui-btn-lg">返回首页</a>
   </div> 
  </div>
  <div class="fly-extend-detail layui-card"> 
   <div class="layui-container"> 
    <div class="fly-extend-list-header"> 
     <h1 class="fly-extend-title layui-elip"> <a>openTable</a> <span class="layui-badge layui-bg-green layui-hide-xs">openTable</span> </h1> 
     <div class="fly-extend-list-info"> <a href="/u/20851320/index.html" target="_blank" class="fly-extend-list-user" title="发布者"> <cite class="layui-hide-xs">胡邦**茂</cite> <img src="/avatar/20851320.png" alt="胡邦**茂"> </a> 
     </div> 
    </div> 
    <blockquote class="fly-extend-list-desc layui-elem-quote"> 
     <p>可展开显示更多内容的Table【应用在表格列过多时，支持layui.table的所有参数 + 4个扩展参数详情见文档】【专业解决表格列过多问题】</p> 
    </blockquote> 
    <div class="fly-extend-list-bottom"> <span class="layui-inline">更新：2020-1-17 </span> <span class="layui-inline">创建：2019-11-24 </span> 
     <div class="layui-btn-container layui-extend-doc-edit"> 
     </div> 
    </div> 
   </div>
  </div>
  <div class="layui-container"> 
   <div class="layui-row layui-col-space20"> 
    <div class="layui-col-sm3 layui-col-md2"> 
     <div class="layui-card"> 
      <ul class="fly-extend-doc-nav" lay-filter="extend-doc-nav"> 
       <li class="layui-this" lay-id="doc"> <a href="javascript:;"><i class="iconfont icon-wendang"></i> 文档</a> </li> 
       <li lay-id="download"> <a href="javascript:;"><i class="iconfont icon-xiazai"></i> 下载</a> </li> 
       <li lay-id=""> <a href="https://hbangmao.gitee.io/?href=1&amp;type=1" rel="nofollow" target="_blank"> <i class="iconfont icon-kaifashili"></i> 来源 </a> </li> 
      </ul> 
     </div> 
    </div> 
    <div class="layui-col-sm9 layui-col-md10"> 
     <div class="layui-card fly-extend-doc layui-show"> 
      <div class="layui-card-header"> 
       <h3 class="layui-inline layui-this">文档</h3> 
      </div> 
      <div class="layui-card-body detail-body photos layui-text"> 
       <hr>
       <img src="/upload/2019_11/20851320_1574158404356_52762.png"> 
       <br>
       <hr>新增展开数据可从网络加载
       <br>
       <hr>
       <img src="/upload/2020_1/20851320_1579171456781_34966.png"> 
       <br>
       <br>
       <br>
       <pre>  //↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 使用案例  简单版↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓<br><br>  layui.config({<br>    //配置 layui 第三方扩展组件存放的基础目录<br>    base: '../../../layui_exts/'<br>  }).extend({<br>    openTable: 'openTable/openTable'<br>  }).use(['openTable'], function () {<br>    layui.openTable.render({<br>      elem: '#test'<br>      , id: '#test'<br>      , url: 'test.json'<br>      , toolbar: '#barDemo'<br>      , cols: [[<br>        {field: 'id', title: 'ID', sort: true}<br>        , {field: 'username', title: '用户名', edit: true}<br>        , {field: 'city', title: '城市', edit: true}<br>        , {title: '操作', toolbar: '#barDemo', width: 150}<br>      ]]<br><br>      //注：展开的列Items<br>      , openCols: [<br>        {<br>          field: 'sign', title: '签名', templet: function (item) {<br>            // 重新定义排版<br>            return "&lt;div style='background: #333333;color: white'&gt;" + item.sign + "&lt;/div&gt;"<br>          }<br>        }<br>        , {<br>          field: 'wealth', title: '财富', onDraw: function (it, item) {<br>            // 使用默认风格排版 【左边title+右边值+下划线】<br>            return item['wealth'];<br>          }<br>        }<br>        , {field: 'experience', title: '积分'}<br>        , {field: 'classify', title: '职业'}<br>      ]<br><br>      //注：监听排序 {openTable}<br>      , sort: function (obj) {<br>        console.log(obj)<br>      }<br>      //注：0：同时只展开一项 1：一直展开不关闭之前  def：0 {openTable}<br>      , openType: 0<br><br>    });<br><br>    // 工具栏点击案例<br>    layui.table.on('toolbar(test)', function (obj) {<br>      layer.msg("点击了");<br>    });<br><br>    //注：表格重载案例<br>    layui.jquery(".btn-demo-reload").click(function () {<br>      layui.table.reload("#test", {where: {text: "测试搜索条件"}});<br>    });<br><br><br>    //TODO 注：其他相关案例与layui官网同步,需要使用[layui.table]<br><br>    //注：更新样例代码格式化展示 实际开发可忽略不管<br>    setTimeout(function () {<br>      layui.$('.layui-code').text(layui.$('#demo-script').html())<br>    }, 20)<br>  });</pre>
       <hr>需要注意的是：1、监听排序需使用sort回调函数
       <br> 2、以上为简单案例，完整版支持展开列的修改(展开列支持layui select下拉控件) 
       <br>
       <br>
       <br>
       <br> 码云 <a href="https://gitee.com/Hbangmao/layui_extend_openTable" target="_blank" rel="nofollow">https://gitee.com/Hbangmao/layui_extend_openTable</a> 
       <br>
       <br>相关帖子 <a href="/jie/62195/" target="_blank">/jie/62195/</a>
       <br>
       <br>在线体验 <a href="https://hbangmao.gitee.io/?href=1&amp;type=1" target="_blank" rel="nofollow">https://hbangmao.gitee.io/?href=1&amp;type=1</a> 
       <br> 
       <br>此项目以码云更新为准，长期维护 。
       <br>
       <img alt="[围观]" title="[围观]" src="/t4/appstyle/expression/ext/normal/f2/wg_thumb.gif"> 祝你使用开心
       <br> 
      </div> 
     </div> 
     <div class="layui-card fly-extend-doc"> 
      <div class="layui-card-header"> 
       <h3 class="layui-inline layui-this">下载</h3> 
      </div> 
      <div class="layui-card-body detail-body layui-text"> 
       <div class="layui-btn-container"> <a href="//cdn.layui.com/extend/20851320_1574158475971_3892.rar" target="_blank" class="layui-btn layui-btn-lg layui-btn-primary"> 立即下载 </a> <a href="https://gitee.com/Hbangmao/layui_extend_openTable" target="_blank" class="layui-btn layui-btn-lg layui-btn-primary layui-border-red"> 去码云下载 </a> 
        <blockquote class="layui-elem-quote">
          该扩展组件由第三方用户主动投递，并由其自身进行维护，本站仅做收集。 
        </blockquote> 
       </div> 
      </div> 
     </div> 
    </div> 
   </div>
  </div>
  <div class="fly-footer"> 
   <p>Copyright © 2021 <a href="/index.html">layui.itmtr.cn</a> MIT Licensed</p>
  </div>
  <script src="/layui/dist/layui.js"></script>
  <script>// common</script>

 </body>
<script src="/common/common.js"></script>
</html>